celesteh / FisherPriceRecords

Convert a MIDI file to a record compatible with vintage (1970's) Fisher Price music box record players
GNU General Public License v3.0
6 stars 1 forks source link

Help with the code #3

Open superchargedtoyota opened 1 year ago

superchargedtoyota commented 1 year ago

Hello,

I do not know if this is the correct way to do this but I'd try. I am very very green / new in regards to Github and this programming but I am trying to learn to make the records for my son.

I have SuperCollider IDE open, I have the wslib quak installed. I have opened up the FisherPriceRecords.sc file into SuperCollider IDE. Here is where my error starts. Maybe, I do not understand where I need to put the code. But thank you if you have the time to respond.

I opened up FisherPriceRecords.SC and go down to the very bottom. I have typed there the following

f = FisherPriceRecords.openMIDI("C:\Users\Cody\Downloads\Mario\1.mid".standardizePath, "Mario");

I highlight that code and hit CTRL-Enter and get the following error

ERROR: Class not defined. in interpreted text line 1 char 22:

f = FisherPriceRecords.openMIDI("C:\Users\Cody\Downloads\Mario\1.mid".standardizePath, "Mario");


-> nil

Thank you for any info you might have and taking the time to respond.

celesteh commented 1 year ago

Hi,

This is a SuperCollider extension. I've added a Quark file which should help you. Evaluate Quarks.install("https://github.com/celesteh/FisherPriceRecords.git");

Then recompile the class library (See the Language menu) and then try the example again.

superchargedtoyota commented 1 year ago

Thank you for the reply.

I downloaded the FisherPriceRecords.quark file you added.

When I go to the Quarks menu and select load quarks set it will say Installing from file : filepath/FisherPriceRecords.quark

and in the table I get

ERROR: Quark '(' not found

PROTECTED CALL STACK: Meta_Quark:new 0000023AC5AEEA40 arg this = Quark arg name = ( arg refspec = arg url = nil arg localPath = nil var args = nil Meta_Quarks:install 0000023AB61FE680 arg this = Quarks arg name = ( arg refspec = var path = nil var quark = nil a FunctionDef 0000023AB6200E40 sourceCode = "" Function:forkIfNeeded 0000023AC9F46B00 arg this = a Function arg clock = AppClock arg quant = nil arg stackSize = nil Meta_Quarks:load 0000023AB6200700 arg this = Quarks arg path = C:/Users/Cody/Downloads/Mario/FisherPriceRecords.quark arg done = a Function var file = a File var line = ( var dir = C:/Users/Cody/Downloads/Mario var re = ^([^=]+)=?([^@]+)@?(.)$ var nameRe = ^([^@]+)@?(.)$ var match = [ [ 0, ( ], [ 0, ( ], [ 1, ] ] var localPath = nil var url = nil var name = ( var refspec = var q = nil Function:prTry 0000023AC9F48A00 arg this = a Function var result = nil var thread = a Routine var next = nil var wasInProtectedFunc = true

CALL STACK: Exception:reportError arg this = < closed FunctionDef > arg error = Integer:forBy arg this = 0 arg endval = 0 arg stepval = 2 arg function = var i = 0 var j = 0 SequenceableCollection:pairsDo arg this = [*2] arg function = Scheduler:seconds_ arg this = arg newSeconds = 289.9314281 Meta_AppClock:tick arg this = var saveClock = Process:tick arg this = ^^ The preceding error dump is for ERROR: Quark '(' not found

It doesn't seem to do anything after this.

superchargedtoyota commented 1 year ago

I think I figured it out. Maybe, I don't have time to check at the moment. I put all the files for this github in it's own folder and not the SuperCollider Extension folder. Sorry, I am new. I will check this out and report back. Thank you for your patience.

superchargedtoyota commented 1 year ago

So I have placed the FischerPriceRecords.sc and .schelp within the SuperCollider edtentions folder.

I have installed your FisherPriceRecords.Quark to the downloaded quarks folder.

I hoped up supercollider and recompiled the class library and got the following


compiling class library... Found 853 primitives. Compiling directory 'C:\Program Files\SuperCollider-3.13.0\SCClassLibrary' Compiling directory 'C:\ProgramData\SuperCollider\Extensions' Compiling directory 'C:\Users\Cody\AppData\Local\SuperCollider\Extensions' Compiling directory 'C:\Users\Cody\AppData\Local\SuperCollider\downloaded-quarks\FischerPrice' Compiling directory 'C:\Users\Cody\AppData\Local\SuperCollider\downloaded-quarks\XML' Compiling directory 'C:\Users\Cody\AppData\Local\SuperCollider\downloaded-quarks\wslib' numentries = 1016009 / 18499000 = 0.055 7115 method selectors, 2600 classes method table size 18186304 bytes, big table size 147992000 Number of Symbols 16193 Byte Code Size 605804 compiled 547 files in 0.23 seconds

Info: 2 methods are currently overwritten by extensions. To see which, execute: MethodOverride.printAll

compile done localhost : setting clientID to 0. internal : setting clientID to 0. Class tree inited in 0.01 seconds

Welcome to SuperCollider 3.13.0. For help press Ctrl-D.


Under language --> Quarks I verified that FischerPrice, XML, and WSLib are installed with green check marks.

I then have blank form open and enter

f = FisherPriceRecords.openMIDI("C:\Users\Cody\Downloads\Mario\1.mid".standardizePath, "Mario");

That is the direct path to the midi file.

When I select that line and hit CTRL+Enter I get the following

ERROR: Primitive '_FilePos' failed. Failed. RECEIVER: Instance of File { (0000026D63DEECA8, gc=CC, fmt=00, flg=00, set=02) instance variables [1] fileptr : nil } CALL STACK: MethodError:reportError arg this = Nil:handleError arg this = nil arg error = Thread:handleError arg this = arg error = Object:throw arg this = Object:primitiveFailed arg this = SimpleMIDIFile:read arg this = var file = var time = nil FisherPriceRecords:initFile arg this = arg file = "C:UsersCodyDownloadsMario1.mid" arg name = "Mario" var midi = nil var events = nil var start = nil var type = nil var note = nil var velocity = nil < closed FunctionDef > (no arguments or variables) Interpreter:interpretPrintCmdLine arg this = var res = nil var func = var code = "f = FisherPriceRecords.openM..." var doc = nil var ideClass = Process:interpretPrintCmdLine arg this = ^^ The preceding error dump is for ERROR: Primitive '_FilePos' failed. Failed. RECEIVER: a File


Thank again for the help.

superchargedtoyota commented 1 year ago

I also tried your code you posted earler EvaluateQuarks.install("https://github.com/celesteh/FisherPriceRecords.git");

and received

Installing FisherPriceRecords Installing wslib Installing XML XML installed wslib installed FisherPriceRecords installed -> Quark: FisherPriceRecords[1.0.2]

Then I went Language --> Recompile Class Library and received.

compiling class library... Found 853 primitives. Compiling directory 'C:\Program Files\SuperCollider-3.13.0\SCClassLibrary' Compiling directory 'C:\ProgramData\SuperCollider\Extensions' Compiling directory 'C:\Users\Cody\AppData\Local\SuperCollider\Extensions' Compiling directory 'C:\Users\Cody\AppData\Local\SuperCollider\downloaded-quarks\FischerPrice' Compiling directory 'C:\Users\Cody\AppData\Local\SuperCollider\downloaded-quarks\XML' Compiling directory 'C:\Users\Cody\AppData\Local\SuperCollider\downloaded-quarks\wslib' Compiling directory 'C:\Users\Cody\AppData\Local\SuperCollider\downloaded-quarks\FisherPriceRecords' numentries = 1016010 / 18499000 = 0.055 7115 method selectors, 2600 classes method table size 18193392 bytes, big table size 147992000 Number of Symbols 16193 Byte Code Size 605907 compiled 547 files in 0.23 seconds

Info: 2 methods are currently overwritten by extensions. To see which, execute: MethodOverride.printAll

compile done localhost : setting clientID to 0. internal : setting clientID to 0. Class tree inited in 0.01 seconds

Welcome to SuperCollider 3.13.0. For help press Ctrl-D.

I then copied

f = FisherPriceRecords.openMIDI("C:\Users\Cody\Downloads\Mario\1.mid".standardizePath, "Mario");

and got ERROR: Primitive '_FilePos' failed. Failed. RECEIVER: Instance of File { (000002A7AD3313B8, gc=A8, fmt=00, flg=00, set=02) instance variables [1] fileptr : nil } CALL STACK: MethodError:reportError arg this = Nil:handleError arg this = nil arg error = Thread:handleError arg this = arg error = Object:throw arg this = Object:primitiveFailed arg this = SimpleMIDIFile:read arg this = var file = var time = nil FisherPriceRecords:initFile arg this = arg file = "C:UsersCodyDownloadsMario1.mid" arg name = "Mario" var midi = nil var events = nil var start = nil var type = nil var note = nil var velocity = nil < closed FunctionDef > (no arguments or variables) Interpreter:interpretPrintCmdLine arg this = var res = nil var func = var code = "f = FisherPriceRecords.openM..." var doc = nil var ideClass = Process:interpretPrintCmdLine arg this = ^^ The preceding error dump is for ERROR: Primitive '_FilePos' failed. Failed. RECEIVER: a File

superchargedtoyota commented 1 year ago

Do you think the version of supercollider has anything to do with my issues?

celesteh commented 1 year ago

Try

f = FisherPriceRecords.openMIDI("C:\\Users\\Cody\\Downloads\\Mario\\1.mid".standardizePath, "Mario");
rcamp5656 commented 1 month ago

I too am looking into this , is there a command line to run that package from withing another program and have it work? I have a full QB64 program that will do all of the work of loading the file etc. fisherpricemenu.txt Russ Campbell

celesteh commented 1 month ago

What this program does is take a MIDI file and from it generate an openScad file. If you program has lists of notes in it and you want to use them to make a record, you can skip using my program and instead add it in to your own. This tuorial should give you an idea of how to do that: https://www.instructables.com/3D-printing-records-for-a-Fisher-Price-toy-record-/

rcamp5656 commented 1 month ago

I use the Music Box Maniacs site then a custom batch file to run everything ... I can send the batch file but everything will be up on Github. Thanks Charles.


From: Charles Céleste Hutchins @.> Sent: Friday, September 27, 2024 9:52 AM To: celesteh/FisherPriceRecords @.> Cc: rcamp5656 @.>; Comment @.> Subject: Re: [celesteh/FisherPriceRecords] Help with the code (Issue #3)

What this program does is take a MIDI file and from it generate an openScad file. If you program has lists of notes in it and you want to use them to make a record, you can skip using my program and instead add it in to your own. This tuorial should give you an idea of how to do that: https://www.instructables.com/3D-printing-records-for-a-Fisher-Price-toy-record-/

— Reply to this email directly, view it on GitHubhttps://github.com/celesteh/FisherPriceRecords/issues/3#issuecomment-2379690958, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ATO7ZPRAC4JJKIHZ5CQA2ITZYWELTAVCNFSM6AAAAABO7PI3HWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNZZGY4TAOJVHA. You are receiving this because you commented.