Files
genode-world/run/chuck.run
Emery Hemingway 73948ac1b2 app/chuck: pass Env to session connections, input support
- Initialize RtAudio with component env.
- Mouse and keyboard input support.
- Audio synthesis run scenarios.

Fix #73
2017-04-25 11:40:28 +02:00

132 lines
2.2 KiB
Plaintext

assert_spec x86
# Xmllint throws errors on inline chuck code
proc check_xml_syntax {xml_file} { }
#
# Build
#
set build_components {
core init
app/chuck
drivers/audio
drivers/timer
}
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
create_boot_directory
#
# Config
#
append config {
<config>
<parent-provides>
<service name="CPU"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="IRQ"/>
<service name="LOG"/>
<service name="PD"/>
<service name="RAM"/>
<service name="RM"/>
<service name="ROM"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>}
append_platform_drv_config
append config {
<start name="audio_drv">
<binary name="} [audio_drv_binary] {"/>
<resource name="RAM" quantum="8M"/>
<provides> <service name="Audio_out"/> </provides>
<config/>
</start>
<start name="chuck">
<resource name="RAM" quantum="32M"/>
<config dac_channels="2" adc_channels="0">
<libc stdout="/log" stderr="/log"/>
<vfs> <log/>
<inline name="test">
// another candidate for lamest demo
// patch
SinOsc s => JCRev r => dac;
.5 => r.gain;
.075 => r.mix;
// note number
20 => float note;
// go up to 127
while( note < 128 )
{
// convert MIDI note to hz
Std.mtof( note ) => s.freq;
// turn down the volume gradually
.5 - (note/256.0) => s.gain;
// move up by whole step
note + 2 => note;
// advance time
.125::second => now;
}
// turn off s
0 => s.gain;
// wait a bit
2::second => now;
</inline>
</vfs>
<file path="/test"/>
</config>
<route>
<any-service><parent/><any-child/></any-service>
</route>
</start>
</config>}
install_config $config
#
# Boot modules
#
append boot_modules {
core init ld.lib.so
timer
chuck
libogg.lib.so
libFLAC.lib.so
libsndfile.lib.so
libvorbis.lib.so
pthread.lib.so
stdcxx.lib.so
libc.lib.so
libm.lib.so
} [audio_drv_binary] {
}
append_platform_drv_boot_modules
build_boot_image $boot_modules
append qemu_args " -m 128 -nographic -soundhw es1370 "
run_genode_until {child "chuck" exited with exit value 0} 60