diff --git a/tutorial/chapters/BasicTypesTutorial.md b/tutorial/chapters/BasicTypesTutorial.md index 01fd8197..3102c032 100644 --- a/tutorial/chapters/BasicTypesTutorial.md +++ b/tutorial/chapters/BasicTypesTutorial.md @@ -292,10 +292,22 @@ The `readWav` and `loopWav` can read the file with given speed. The 1 is a normal speed. The -1 is playing in reverse. Negative speed works only for `loopWav`. -So we can read our friends record like this: +So we can read *.wav file like this: ~~~{.haskell} -let sample = loopSnd "Composite.wav" +$ ghci +Prelude> :m +Csound.Base +Prelude Csound.Base> -- play the *.wav file +Prelude Csound.Base> dac $ readSnd "Composite.wav" +Prelude Csound.Base> -- continuously play the *.wav file +Prelude Csound.Base> dac $ loopSnd "Composite.wav" +Prelude Csound.Base> -- set period of continuous play to 2 seconds +Prelude Csound.Base> dac $ loopSndBy 2 "Composite.wav" +Prelude Csound.Base> -- set speed of playback +Prelude Csound.Base> dac $ readWav 2 "Composite.wav" +Prelude Csound.Base> -- continuously play at the set speed +Prelude Csound.Base> dac $ loopWav 3 "Composite.wav" +Prelude Csound.Base> :q ~~~ If we want only a portion of the sound to be played we can use the diff --git a/tutorial/chapters/ProducingTheOutputTutorial.md b/tutorial/chapters/ProducingTheOutputTutorial.md index e321fc63..c2563389 100644 --- a/tutorial/chapters/ProducingTheOutputTutorial.md +++ b/tutorial/chapters/ProducingTheOutputTutorial.md @@ -47,7 +47,14 @@ Let's write a 10 seconds of concert A (440 Hz). We can use it for tuning: ~~~haskell -> writeSnd "A.wav" $ setDur 10 $ osc 440 +$ ghci +Prelude> :m Csound.Air.Wave Csound.Options Csound.IO +Prelude Csound.Air.Wave Csound.Options Csound.IO> writeSnd "A.wav" $ setDur 10 $ osc 440 +Prelude Csound.Air.Wave Csound.Options Csound.IO> :q +$ file A.wav + A.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 44100 Hz +$ aplay A.wav + Playing WAVE 'A.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono ~~~ The audio is going to be rendered off-line. The good thing